﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AlbumDesigner.Helpers;

namespace AlbumDesigner.Controllers
{
    public class LoggerController : Controller
    {
        //
        // GET: /Logger/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult AddLine(string level, string category, string timestamp, string message)
        {
            Boolean result;
            
            try
            {
                LoggerHelper.AddLine(level, category, timestamp, message);
                result = true;
            }
            catch (Exception)
            {
                result = false;
            }

            return Json(result, JsonRequestBehavior.AllowGet);
        }

    }
}
